<script setup lang="ts">
import { useSettingsStore } from '@/store/modules/settings';
import { handleThemeStyle } from '@/utils/theme';
import { useAppStore } from '@/store/modules/app';

const appStore = useAppStore();
const settingsStore = useSettingsStore();

onMounted(() => {
  nextTick(() => {
    settingsStore.initSetting(() => {
      // 初始化主题样式
      handleThemeStyle(settingsStore.theme);
    });
  });
});
</script>

<template>
  <el-config-provider :locale="appStore.locale" :size="appStore.size as any">
    <div v-loading="!settingsStore.initEnd" style="height: 100%;width: 100%;">
      <router-view />
    </div>
  </el-config-provider>

</template>
